package com.jili.blog.dao.controller;

import com.jili.blog.service.SysUserService;
import com.jili.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: Jili
 * @date: Created on 2021/8/4 14:01
 */
@RestController
@RequestMapping("users")
public class UsersController {
    @Autowired
    private SysUserService sysUserService;

    @GetMapping("currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){
        return  sysUserService.findUserByToken(token);
    }

}
